<include file="App/Admin/View/Public/left.html"/>
  <script type="text/javascript" charset="utf-8" src="__PUBLIC__/kindeditor/kindeditor.js"></script>
  <script type="text/javascript" charset="utf-8" src="__PUBLIC__/kindeditor/lang/zh_CN.js"></script>
  <script type="text/javascript" charset="utf-8" src="__PUBLIC__/kindeditor/plugins/prettify.js"></script>
<div class="admin">
<div class="panel admin-panel margin-top" id="add">
  <div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 添加Banner图片</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="{:U('Banner/addBanner')}" enctype="multipart/form-data">  
	<input type="hidden" class="input w50" value="{$banner.id|default=''}" name="id" />
          <div class="form-group">
        <div class="label">
          <label>标题：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$banner.title|default=''}" name="title" />
          <div class="tips"></div>
        </div>
      </div>
	  <notempty name="banner.pic">
			<div class="form-group">
			<div class="label">
			  <label>轮播图片：</label>
			</div>
			<div class="field">
				<img style="width: 300px;height: 150px;border-radius: 15px;border: 1px solid;" src="{$banner.pic}"><input type="hidden" name="pic" value="{$banner.pic|default=''}" class="common-text" />
				<input type="hidden" value="{$banner['pic']|default=''}" name="pic_1" />
			</div>
		  </div> 
		</notempty>
	
		<div class="form-group">
        <div class="label">
          <label>轮播图片：</label>
        </div>
        <div class="field">
      <!--  <input type="text" id="url1" name="Filedata" class="input tips" style="width:25%; float:left;"  value="{$flash.pic}" data-toggle="hover" data-place="right" data-image="" />-->
         <!-- <input type="button" class="button bg-blue margin-left" id="image1" value="+ 上传图片"  style="float:left;">-->
		 
			<a class="button input-file bg-blue margin-left" href="javascript:void(0);">+ 上传轮播图片<input size="100" type="file" name="Filedata"  /></a>
			
          <!--<div class="tipss">图片尺寸：1920*500</div>-->
        </div>
   
            <div class="form-group">
        <div class="label">
          <label>链接地址：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$banner.url|default=''}" name="url" />
          <div class="tips"></div>
        </div>
      </div>
	  <div class="form-group">
        <div class="label">
          <label>排序：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$banner.sort|default=''}" name="sort" />
          <div class="tips"></div>
        </div>
      </div>
		<div class="form-group">
        <div class="label">
          <label>显示位置：</label>
        </div>
        <div class="field">
		  <select name="position_id" id="position_id"  class="input input-auto">
			<volist name="list" id="vo">
				<option value="{$vo.position_id}"  <eq name="banner.position_id" value="$vo.position_id">selected="selected"</eq>>{$vo.name}</option>
				<!--<option value="{$banner.position_id}">{$blist.name}</option>-->
				<!--<option value="{$vo.position_id}">{$vo.name}</option>-->
			</volist>
		  </select>
          <div class="tips"></div>
        </div>
      </div>
  
    <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> {$but}</button>
        </div>
      </div>
    </form>
	
  </div>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript">    
 function preview(file)  
 {  
 var prevDiv = document.getElementById('preview');  
 if (file.files && file.files[0])  
 {  
 var reader = new FileReader();  
 reader.onload = function(evt){  
 prevDiv.innerHTML = '<img src="' + evt.target.result + '" />';  
}    
 reader.readAsDataURL(file.files[0]);  
}  
 
 }function preview1(file)  
 {  
 var prevDiv = document.getElementById('preview1');  
 if (file.files && file.files[0])  
 {  
 var reader = new FileReader();  
 reader.onload = function(evt){  
 prevDiv.innerHTML = '<img src="' + evt.target.result + '" />';  
}    
 reader.readAsDataURL(file.files[0]);  
}  
 
 }
 </script>